home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / CoreFoundation / CFDictionary.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  5.1 KB  |  188 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        CFDictionary.h
  3.  
  4.      Contains:    CoreFoundation dictionary collection
  5.  
  6.      Version:    Technology:    Mac OS X
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COREFOUNDATION_CFDICTIONARY__
  18. #define __COREFOUNDATION_CFDICTIONARY__
  19.  
  20. #ifndef __COREFOUNDATION_CFBASE__
  21.     #include <CoreFoundation\CFBase.h>
  22. #endif
  23.  
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47. typedef CALLBACK_API_C( const void *, CFDictionaryRetainCallBack )(CFAllocatorRef allocator, const void *ptr);
  48. typedef CALLBACK_API_C( void , CFDictionaryReleaseCallBack )(CFAllocatorRef allocator, const void *ptr);
  49. typedef CALLBACK_API_C( CFStringRef , CFDictionaryCopyDescriptionCallBack )(const void *ptr);
  50. typedef CALLBACK_API_C( Boolean , CFDictionaryEqualCallBack )(const void *ptr1, const void *ptr2);
  51. typedef CALLBACK_API_C( CFHashCode , CFDictionaryHashCallBack )(const void *ptr);
  52.  
  53. struct CFDictionaryKeyCallBacks {
  54.     CFIndex                         version;
  55.     CFDictionaryRetainCallBack         retain;
  56.     CFDictionaryReleaseCallBack     release;
  57.     CFDictionaryCopyDescriptionCallBack  copyDescription;
  58.     CFDictionaryEqualCallBack         equal;
  59.     CFDictionaryHashCallBack         hash;
  60. };
  61. typedef struct CFDictionaryKeyCallBacks    CFDictionaryKeyCallBacks;
  62. extern const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks;
  63. extern const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks;
  64.  
  65. struct CFDictionaryValueCallBacks {
  66.     CFIndex                         version;
  67.     CFDictionaryRetainCallBack         retain;
  68.     CFDictionaryReleaseCallBack     release;
  69.     CFDictionaryCopyDescriptionCallBack  copyDescription;
  70.     CFDictionaryEqualCallBack         equal;
  71. };
  72. typedef struct CFDictionaryValueCallBacks CFDictionaryValueCallBacks;
  73. extern const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks;
  74. typedef CALLBACK_API_C( void , CFDictionaryApplierFunction )(const void *key, const void *val, void *context);
  75. typedef const struct __CFDictionary * CFDictionaryRef;
  76. typedef struct __CFDictionary * CFMutableDictionaryRef;
  77. EXTERN_API_C( CFTypeID )
  78. CFDictionaryGetTypeID            (void);
  79.  
  80.  
  81. EXTERN_API_C( CFDictionaryRef )
  82. CFDictionaryCreate                (CFAllocatorRef         allocator,
  83.                                  const void **            keys,
  84.                                  const void **            values,
  85.                                  CFIndex                 numValues,
  86.                                  const CFDictionaryKeyCallBacks * keyCallBacks,
  87.                                  const CFDictionaryValueCallBacks * valueCallBacks);
  88.  
  89. EXTERN_API_C( CFDictionaryRef )
  90. CFDictionaryCreateCopy            (CFAllocatorRef         allocator,
  91.                                  CFDictionaryRef         dict);
  92.  
  93. EXTERN_API_C( CFMutableDictionaryRef )
  94. CFDictionaryCreateMutable        (CFAllocatorRef         allocator,
  95.                                  CFIndex                 capacity,
  96.                                  const CFDictionaryKeyCallBacks * keyCallBacks,
  97.                                  const CFDictionaryValueCallBacks * valueCallBacks);
  98.  
  99. EXTERN_API_C( CFMutableDictionaryRef )
  100. CFDictionaryCreateMutableCopy    (CFAllocatorRef         allocator,
  101.                                  CFIndex                 capacity,
  102.                                  CFDictionaryRef         dict);
  103.  
  104.  
  105. EXTERN_API_C( CFIndex )
  106. CFDictionaryGetCount            (CFDictionaryRef         dict);
  107.  
  108. EXTERN_API_C( CFIndex )
  109. CFDictionaryGetCountOfKey        (CFDictionaryRef         dict,
  110.                                  const void *            key);
  111.  
  112. EXTERN_API_C( CFIndex )
  113. CFDictionaryGetCountOfValue        (CFDictionaryRef         dict,
  114.                                  const void *            value);
  115.  
  116. EXTERN_API_C( Boolean )
  117. CFDictionaryContainsKey            (CFDictionaryRef         dict,
  118.                                  const void *            key);
  119.  
  120. EXTERN_API_C( Boolean )
  121. CFDictionaryContainsValue        (CFDictionaryRef         dict,
  122.                                  const void *            value);
  123.  
  124. EXTERN_API_C( const void *)
  125. CFDictionaryGetValue            (CFDictionaryRef         dict,
  126.                                  const void *            key);
  127.  
  128. EXTERN_API_C( Boolean )
  129. CFDictionaryGetValueIfPresent    (CFDictionaryRef         dict,
  130.                                  const void *            key,
  131.                                  const void **            value);
  132.  
  133. EXTERN_API_C( void )
  134. CFDictionaryGetKeysAndValues    (CFDictionaryRef         dict,
  135.                                  const void **            keys,
  136.                                  const void **            values);
  137.  
  138. EXTERN_API_C( void )
  139. CFDictionaryApplyFunction        (CFDictionaryRef         dict,
  140.                                  CFDictionaryApplierFunction  applier,
  141.                                  void *                    context);
  142.  
  143.  
  144. EXTERN_API_C( void )
  145. CFDictionaryAddValue            (CFMutableDictionaryRef  dict,
  146.                                  const void *            key,
  147.                                  const void *            value);
  148.  
  149. EXTERN_API_C( void )
  150. CFDictionarySetValue            (CFMutableDictionaryRef  dict,
  151.                                  const void *            key,
  152.                                  const void *            value);
  153.  
  154. EXTERN_API_C( void )
  155. CFDictionaryReplaceValue        (CFMutableDictionaryRef  dict,
  156.                                  const void *            key,
  157.                                  const void *            value);
  158.  
  159. EXTERN_API_C( void )
  160. CFDictionaryRemoveValue            (CFMutableDictionaryRef  dict,
  161.                                  const void *            key);
  162.  
  163. EXTERN_API_C( void )
  164. CFDictionaryRemoveAllValues        (CFMutableDictionaryRef  dict);
  165.  
  166.  
  167.  
  168. #if PRAGMA_STRUCT_ALIGN
  169.     #pragma options align=reset
  170. #elif PRAGMA_STRUCT_PACKPUSH
  171.     #pragma pack(pop)
  172. #elif PRAGMA_STRUCT_PACK
  173.     #pragma pack()
  174. #endif
  175.  
  176. #ifdef PRAGMA_IMPORT_OFF
  177. #pragma import off
  178. #elif PRAGMA_IMPORT
  179. #pragma import reset
  180. #endif
  181.  
  182. #ifdef __cplusplus
  183. }
  184. #endif
  185.  
  186. #endif /* __COREFOUNDATION_CFDICTIONARY__ */
  187.  
  188.